package com.test;

import com.pccw.hessian.support.client.HessianAsynTask;
import com.pccw.hessian.support.client.HessianAsynTaskExecuter;

public class CRMAsynTaskExecuter<R,E extends Throwable> implements HessianAsynTaskExecuter<R,E>{
	
	@Override
	public void execute(final HessianAsynTask<R,E> listener) {
		new Thread(){
			@Override
			public void run() {
				try {
					listener.onExecuteSuccess(listener.doInBackground());
				} catch (Throwable e) {
					//(E) CRMUtils.parseException(e)
					listener.onExceptionOccured((E) e);
				}finally{
					listener.onFinally(null);
				}
			}
		}.start();
		
	}

}
